package com.woniu.service.Impl.homePage;

import com.woniu.dao.homePage.CommentDao;
import com.woniu.service.homePage.ICommentService;
import com.woniu.util.ResData;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

/**
 * @author 凌雨
 * @data 2023/3/13 11:55
 */
@Service
public class CommentServiceImpl implements ICommentService {

    @Autowired
    private CommentDao commentDao;

    /**
     * 查询所有的评论
     * @return
     */
    @Override
    public ResData<?> queryComment(Integer goodsId) {
        return new ResData<>().ok(commentDao.queryCommentList(goodsId));
    }

    /**
     * 查询商品的评论数量
     * @param goodsId
     * @return
     */
    @Override
    public ResData<?> queryCommentCount(Integer goodsId) {
        return new ResData<>().ok(commentDao.queryCommentCount(goodsId));
    }
}
